<?php
declare(staict_types=1);

namespace app\admin\validate;

use think\Validate;

/**
 * 招聘验证器
 * @package app\admin\validate
 */
class Recruit extends Validate
{
    // 定义验证规则
    protected $rule = [
        'id|ID' => 'require',
        'eid|企业名称' => 'require',
        'uid|发布人' => 'require',
        'position|招聘职位' => 'require',
        'min_salary|最低薪资' => 'require',
        'max_salary|最高薪资' => 'require',
        'weid|工作经验' => 'require',
        'reqid|学历要求' => 'require',
        'detail|职位详情/福利' => 'require',
    ];

    // 定义验证提示
    /**
     * 添加
     * @return Recruit
     */
    public function recruitInsert()
    {
        return $this->remove('id', 'require');
    }

    protected $message = [
        'id.require' => 'ID必须',
        'eid.require' => '请选择企业',
        'uid.require' => '请输入发布人',
        'position.require' => '请输入招聘职位',
        'min_salary.require' => '请选择最低薪资',
        'max_salary.require' => '请选择最高薪资',
        'weid.require' => '请选择工作经验',
        'reqid.require' => '请选择学历要求',
        'detail.require' => '请输入职位详情/福利',
    ];
}
